home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / pull5xa.arc / PULLSTAT.PAS < prev    next >
Pascal/Delphi Source File  |  1989-01-10  |  30KB  |  756 lines

  1. { =========================================================================== }
  2. { PullStat.pas - User Statistics for pull-down menus.      ver 5.Xa, 01-11-89 }
  3. {                                                                             }
  4. { This file contains all the data for GetUserPullStats, GetOverrideStats and  }
  5. { CheckGlobalKeys to configure the menus.                                     }
  6. {   Copyright (c) 1987-1989 James H. LeMay, All rights reserved.              }
  7. { =========================================================================== }
  8.  
  9. { R-,S-,I-,D-,T-,F-,V-,B-,N-,L+ }         { TP4 directives }
  10. {$A-,B-,D-,E-,F-,I-,L-,N-,O-,R-,S-,V-}    { TP5 directives }
  11.  
  12. {$define UseSubMenuCode }
  13. {$define UseHelpWndwCode }
  14. {$define UseDataEntryCode }
  15. {$define UseMsgLineCode }
  16.  
  17. UNIT PullStat;
  18.  
  19. INTERFACE
  20.  
  21. uses
  22.   Crt,Qwik,Wutil,Wndw,Pull,PullDir;
  23.  
  24. { ------------------ Set up your window names here in order: ---------------- }
  25. { This is optional, but it sure helps you in not only understanding the
  26.   program, but also makes it unquestionably easier to rearrange.              }
  27.  
  28. type
  29.   MainMenuNames = (NoMainMenu,FilesMenu,ColorMenu,AutoPartsMenu,EnterDataMenu,
  30.                    OptionsMenu,UtilitiesMenu,IRSmenu,QuitMenu);
  31.  
  32.   {$ifdef UseSubMenuCode }
  33.   SubMenuNames  = (NoSubMenu,TiresMenu,RadioMenu,UpdateMenu,DateMenu,
  34.                    BrandsMenu);
  35.   {$endif }
  36.  
  37.   {$ifdef UseDataEntryCode }
  38.   DataWndwNames = (NoDW,BytesDW,WordsDW,IntegersDW,LongIntsDW,RealsDW,HexDW,
  39.                    CharsDW,StringsDW,PathDW,FileMaskDW,SeatsDW,PriceDW,MonthDW,
  40.                    DayDW,YearDW,YearsDW);
  41.   {$endif }
  42.  
  43.   {$ifdef UseHelpWndwCode }
  44.   HelpWndwNames = (NoHW,WorkWndwHW,TopLineHW,FilesMenuHW,DirMenuHW,
  45.                    BrandsMenuHW,EnterDataMenuHW,IRSmenuHW,DateMenuHW,
  46.                    UpdateMenuHW,ExecChoiceHW,SingleChoiceHW,MultipleChoiceHW,
  47.                    NumericHW,TextHW);
  48.   HelpLineNames = (NoHL,               { HL - HelpLine;  L  - Last }
  49.                    HLw1,HLw2,HLw3,HLw4,HLw5,HLw6, { Work window }
  50.                    HLw7,HLw8,HLw9,HLw10,HLwL,
  51.                    HLt1,HLtL,                     { Top menu }
  52.                    HLb1,HLb2,HLb3,HLb4,HLb5,HLbL, { Brands submenu }
  53.                    HLf1,HLf2,HLf3,HLf4,HLf5,      { Files submenu }
  54.                    HLf6,HLf7,HLf8,HLf9,HLfL,
  55.                    HLdir1,HLdir2,HLdir3,HLdir4,HLdir5,  { Directory submenu }
  56.                    HLdir6,HLdir7,HLdir8,HLdir9,HLdirL,
  57.                    HLe1,HLe2,HLe3,HLe4,HLe5,      { Enter data submenu }
  58.                    HLe6,HLe7,HLe8,HLe9,HLe10,
  59.                    HLe11,HLe12,HLe13,HLe14,HLeL,
  60.                    HLi1,HLi2,HLiL,                { IRS menu }
  61.                    HLd1,HLd2,HLd3,HLdL,           { Date submenu }
  62.                    HLu1,HLu2,HLuL,                { Update submenu }
  63.                    HLx1,HLx2,HLxL,                { eXecute choice menu }
  64.                    HLs1,HLs2,HLsL,                { Single choice menu }
  65.                    HLm1,HLm2,HLmL,                { Multiple choice menu }
  66.                    HLn1,HLn2,HLn3,HLn4,HLn5,HLn6,HLnL,       { Numeric data }
  67.                    HLtx1,HLtx2,HLtx3,HLtx4,HLtx5,HLtx6,HLtxL);  { Text data }
  68.   {$endif UseHelpWndwCode }
  69.  
  70.   {$ifdef UseMsgLineCode }
  71.   MsgLineNames = (NoML,WorkML,TopML,AltML,MainML,SubML,DW_ML,DE_ML,
  72.                   SeqML,HelpML,ProcML,DirML);
  73.   {$endif UseMsgLineCode }
  74.  
  75. const
  76.   FileName: string[12] = 'pulldemo.exe';
  77.  
  78. { Careful! - Always test your last main menu, submenu, data window, and help
  79.   window for run-time error!  It makes sure you have allotted enough memory
  80.   with your constants.  The compiler cannot check it with these typed scalars.}
  81.  
  82. procedure GetUserPullStats;
  83. procedure GetOverrideStats;
  84. procedure CheckGlobalKeys;
  85.  
  86.  
  87. IMPLEMENTATION
  88.  
  89. procedure GetMainMenu (Name: MainMenuNames);
  90. begin
  91.   MRI := ord (Name);
  92.   TopMenu := MainMenu^[MRI];
  93. end;
  94.  
  95. procedure SaveMainMenu;
  96. begin
  97.   MainMenu^[MRI] := TopMenu;
  98. end;
  99.  
  100. {$ifdef UseSubMenuCode }
  101. procedure GetSubMenu (Name: SubMenuNames);
  102. begin
  103.   MRI := ord (Name);
  104.   TopMenu := SubMenu^ [MRI];
  105. end;
  106.  
  107. procedure SaveSubMenu;
  108. begin
  109.   SubMenu^[MRI] := TopMenu;
  110. end;
  111. {$endif }
  112.  
  113. {$ifdef UseHelpWndwCode }
  114. procedure SetHelpLines (Name: HelpWndwNames; First,Last: HelpLineNames);
  115. begin
  116.   HelpWndw[ord(Name)].FirstLine := ord(First);
  117.   HelpWndw[ord(Name)].LastLine  := ord(Last);
  118. end;
  119. {$endif }
  120.  
  121. { ============================ EXEC PROCEDURES ============================== }
  122. { Place procedures for execution by menu pointers, ProcPtr, here.             }
  123. { They MUST be set to FAR calls.                                              }
  124. { --------------------------------------------------------------------------- }
  125.  
  126. {$F+}
  127. procedure DummyProc;
  128. begin
  129.   {$ifdef UseMsgLineCode }
  130.   ShowMsg (ord(ProcML));
  131.   {$endif UseMsgLineCode }
  132.   Delay (1000)
  133. end;
  134.  
  135. procedure GotoDir;
  136. begin
  137.   PullDown:=true;
  138.   MoreCmdSeq:='D';
  139. end;
  140.  
  141. procedure DoDir;
  142. begin
  143.   { Use (FileName,FileName) to initially Hilite a close match. }
  144.   { Use (FileName,'') to start at default. }
  145.   PullDirectory (FileName,FileName);
  146. end;
  147.  
  148. procedure SetQuit;
  149. begin
  150.   PopToWorkWndw := true;
  151.   Quit := true;
  152. end;
  153.  
  154. procedure ProcessThenPop;
  155. begin
  156.   { Here's how to process and then pop the menus. }
  157.   DummyProc;
  158.   PopToWorkWndw := true;
  159. end;
  160.  
  161. procedure PopThenProcess;
  162. begin
  163.   { Here's how to pop first and then process. }
  164.   if Popped then DummyProc;
  165. end;
  166.  
  167. procedure PopProcessAndPull;
  168. begin
  169.   { Here's how to pop the menus first, process and then pull the same }
  170.   { menus back again which is good for updating the work window. }
  171.   if Popped then DummyProc;
  172.   PullDown := true;
  173. end;
  174.  
  175. procedure PopNumOfLevels;
  176. begin
  177.   { Here's how to pop by a number of levels so that part of the menus will }
  178.   { remain displayed while going to another submenu. }
  179.   PopLevels  := 1;
  180.   PullDown   := true;
  181.   MoreCmdSeq := 'Y';
  182. end;
  183.  
  184. procedure PopToNewMenu;
  185. begin
  186.   { Here's how to go to a completely different menu. }
  187.   PopToTop   := true;
  188.   PullDown   := true;
  189.   MoreCmdSeq := 'AR';
  190. end;
  191.  
  192. procedure DateMenu1;
  193. begin
  194.   PullDown   := true;
  195.   MoreCmdSeq := 'D';
  196. end;
  197.  
  198. procedure DateMenu2;
  199. begin
  200.   PullDown   := true;
  201.   MoreCmdSeq := 'Y';
  202. end;
  203.  
  204. procedure DateMenu3;
  205. begin
  206.   PopLevels := 1;
  207. end;
  208. {$F-}
  209.  
  210. { ======================== GetUserPullStats ================================= }
  211. { The major configurations for all menus go here.  The program first clears   }
  212. { all RECORD values to $00.  The values below will set new values. Therefore, }
  213. { setting RECORD values to "false" or the like is not necessary.              }
  214. { --------------------------------------------------------------------------- }
  215.  
  216. procedure GetUserPullStats;
  217. begin
  218.   LocationWarning:=true;   { If true and a Submenu won't fit, a message is
  219.                              displayed.  If false, you can override the
  220.                              location without the message. }
  221.  
  222.   { ------------------ Set up your colors and borders here: ---------------- }
  223.   TopLineAttr   := Black+LightGrayBG;
  224.   TopLineHattr  := White+BlackBG;
  225.  
  226.   MainMenuBattr := LightGray+BlackBG;
  227.   MainMenuHattr := Black+LightGrayBG;
  228.   MainMenuLattr := Yellow+BlackBG;
  229.   MainMenuCattr := LightGray+BlackBG;
  230.   Brdr[UserBrdr1].BrdrArray := '╒═╕││└─┘╞═╡╤│┴╪';
  231.   MainMenuBrdr  := UserBrdr1;
  232.  
  233.   {$ifdef UseSubMenuCode }
  234.   SubMenuWattr  := Black+CyanBG;
  235.   SubMenuBattr  := Black+CyanBG;
  236.   SubMenuBrdr   := SingleBrdr;
  237.   {$endif UseSubMenuCode }
  238.  
  239.   if VideoMode=7 then
  240.     begin
  241.       TopLineLattr := TopLineAttr;
  242.       MainMenuWattr:= LightGray+BlackBG;
  243.       {$ifdef UseSubMenuCode }
  244.       SubMenuHattr := Black    +LightGrayBG;
  245.       SubMenuLattr := White    +BlackBG;
  246.       SubMenuCattr := LightGray+BlackBG;
  247.       {$endif UseSubMenuCode }
  248.     end
  249.   else
  250.     begin
  251.       TopLineLattr := Red  +LightGrayBG;
  252.       MainMenuWattr:= White+BlackBG;
  253.       {$ifdef UseSubMenuCode }
  254.       SubMenuHattr := White+BlueBG;
  255.       SubMenuLattr := White+CyanBG;
  256.       SubMenuCattr := Blue +CyanBG;
  257.       {$endif UseSubMenuCode }
  258.     end;
  259.  
  260.   {$ifdef UseHelpWndwCode }
  261.   HelpWndwWattr := Black+GreenBG;
  262.   HelpWndwBattr := Black+LightGrayBG;
  263.   HelpWndwBrdr  := HdoubleBrdr;
  264.   HelpWndwModes := ZoomMode+ShadowRight+CursorOffMode;
  265.   HelpBottomRow := CRTrows-4;
  266.   {$endif UseHelpWndwCode }
  267.  
  268.   {$ifdef UseMsgLineCode }
  269.   MsgLineAttr   := Green+BlackBG;
  270.   if QvideoMode=Mono then
  271.        KeyStatusAttr := LightGrayBG
  272.   else KeyStatusAttr := Black+GreenBG;
  273.   ErrMsgAttr    := Yellow+RedBG;
  274.   MsgLineRow    := CRTrows;
  275.   {$endif UseMsgLineCode }
  276.  
  277.  
  278.   { ------------------------- Top Menu defaults ----------------------------- }
  279.   TopLineRow := 2;      { Top line menu to appear on row 2 }
  280.   MPulled    := 3;      { Main menu title to be HiLited when F10 is pressed. }
  281.   MoreCmdSeq := 'ATB';  { Sequence of command letter(s) as if keyed in.  This }
  282.                         { will be the default menu(s) pulled. }
  283.   PullDown   := false;  { Set this true if you want the command sequence}
  284.                         {  to pull down the menus at startup. }
  285.  
  286.   { ------------------- Set up your MainMenu records here: ------------------ }
  287.   MainMenuRow := 3;       { First row of Main menus to appear on screen row 3 }
  288.  
  289.   with TopMenu do
  290.   begin
  291.  
  292.     GetMainMenu (FilesMenu);
  293.     MenuMode:=SingleChoice;        SingleFlagLine:=5;
  294.     Title:='Files';
  295.     Line[1]:='Path';               LineMode[1]:=ToDataWndw;
  296.                                    LinkNum [1]:=ord(PathDW);
  297.     Line[2]:='Mask for Directory'; LineMode[2]:=ToDataWndw;
  298.                                    LinkNum [2]:=ord(FileMaskDW);
  299.                                    ProcPtr [2]:=@GotoDir;
  300.     Line[3]:='Directory';          LineMode[3]:=ToUserWndw;
  301.                                    ProcPtr [3]:=@DoDir;
  302.     Line[4]:='──────────────────'; LineMode[4]:=Comment;
  303.     Line[5]:='Merge';
  304.     Line[6]:='make Backup';
  305.     Line[7]:='text Out';
  306.     Line[8]:='';                   LineMode[8]:=Partition;
  307.     Line[9]:='Help comment';       LineMode[9]:=Comment;
  308.     DefaultLine := 3;
  309.     MsgLineNum  := ord(MainML);
  310.     HelpWndwNum := ord(FilesMenuHW);
  311.     SaveMainMenu;
  312.  
  313.     GetMainMenu (ColorMenu);
  314.     MenuMode:=SingleChoice;     SingleFlagLine:=2;
  315.     Title:='Color';
  316.     Line[1]:='Blue';
  317.     Line[2]:='Green';
  318.     Line[3]:='Orange';
  319.     Line[4]:='Yellow';
  320.     Line[5]:='Red';
  321.     Line[6]:='Cyan';
  322.     Line[7]:='Ultraviolet';
  323.     DefaultLine := 5;
  324.     MsgLineNum  := ord(MainML);
  325.     HelpWndwNum := ord(SingleChoiceHW);
  326.     SaveMainMenu;
  327.  
  328.     GetMainMenu (AutoPartsMenu);
  329.     MenuMode:=MultipleChoice;
  330.     Title:='AutoParts';
  331.     Line[1]:='Tires';           LineMode[1]:=ToSubMenu;
  332.                                 LinkNum [1]:=ord(TiresMenu);
  333.     Line[2]:='Radio';           LineMode[2]:=ToSubMenu;
  334.                                 LinkNum [2]:=ord(RadioMenu);
  335.     Line[3]:='Seats';           LineMode[3]:=ToDataWndw;
  336.                                 LinkNum [3]:=ord(SeatsDW);
  337.     Line[4]:='Mirrors';         Flagged[4]:=true;
  338.     Line[5]:='Locks';
  339.     Line[6]:='HiBeams';         Flagged[6]:=true;
  340.     Line[7]:='Wheels';
  341.   { DefaultLine := 1; }       { This is the default }
  342.     MsgLineNum  := ord(MainML);
  343.     HelpWndwNum := ord(MultipleChoiceHW);
  344.     SaveMainMenu;
  345.  
  346.     GetMainMenu (EnterDataMenu);
  347.     MenuMode:=MultipleChoice;
  348.     Title:='EnterData';
  349.     Line[1]:='Byte';            LineMode[1]:=ToDataWndw;
  350.                                 LinkNum [1]:=ord(BytesDW);
  351.     Line[2]:='Word';            LineMode[2]:=ToDataWndw;
  352.                                 LinkNum [2]:=ord(WordsDW);
  353.     Line[3]:='Integer';         LineMode[3]:=ToDataWndw;
  354.                                 LinkNum [3]:=ord(IntegersDW);
  355.     Line[4]:='LongInt';         LineMode[4]:=ToDataWndw;
  356.                                 LinkNum [4]:=ord(LongIntsDW);
  357.     Line[5]:='Real';            LineMode[5]:=ToDataWndw;
  358.                                 LinkNum [5]:=ord(RealsDW);
  359.     Line[6]:='Hex';             LineMode[6]:=ToDataWndw;
  360.                                 LinkNum [6]:=ord(HexDW);
  361.     Line[7]:='Character';       LineMode[7]:=ToDataWndw;
  362.                                 LinkNum [7]:=ord(CharsDW);
  363.     Line[8]:='String';          LineMode[8]:=ToDataWndw;
  364.                                 LinkNum [8]:=ord(StringsDW);
  365.     DefaultLine := 2;
  366.     MsgLineNum  := ord(MainML);
  367.     HelpWndwNum := ord(EnterDataMenuHW);
  368.     SaveMainMenu;
  369.  
  370.     GetMainMenu (OptionsMenu);
  371.     MenuMode:=MultipleChoice;
  372.     Title:='Options';
  373.     Line[1]:='Dual drive';
  374.     Line[2]:='Hard disk';       Flagged[2]:=true;
  375.     Line[3]:='Extended Mem';
  376.     Line[4]:='CGA';             Flagged[4]:=true;
  377.     Line[5]:='VGA';
  378.     Line[6]:='KeyBoard';
  379.     Line[7]:='Price limit';     LineMode[7]:=ToDataWndw;
  380.                                 LinkNum [7]:=ord(PriceDW);
  381.     MsgLineNum  := ord(MainML);
  382.     HelpWndwNum := ord(MultipleChoiceHW);
  383.     SaveMainMenu;
  384.  
  385.     GetMainMenu (UtilitiesMenu);
  386.   { MenuMode:=ExecChoice; }     { This is the default }
  387.     Title:='Utilities';
  388.     Line[1]:='Copy   files';    ProcPtr[1] := @DummyProc;
  389.     Line[2]:='Delete files';    ProcPtr[2] := @DummyProc;
  390.     Line[3]:='List   file';     ProcPtr[3] := @DummyProc;
  391.     Line[4]:='Edit   file';     ProcPtr[4] := @DummyProc;
  392.     Line[5]:='Find   file';     ProcPtr[5] := @DummyProc;
  393.     Line[6]:='Rename file';     ProcPtr[6] := @DummyProc;
  394.     Line[7]:='Sort   files';    ProcPtr[7] := @DummyProc;
  395.     DefaultLine := 2;
  396.     MsgLineNum  := ord(MainML);
  397.     HelpWndwNum := ord(ExecChoiceHW);
  398.     SaveMainMenu;
  399.  
  400.     GetMainMenu (IRSmenu);
  401.   { MenuMode:=ExecChoice; }     { This is the default }
  402.     Title:='IRSaccounting';
  403.     Line[1]:='Date';            LineMode[1]:=ToSubMenu;
  404.                                 LinkNum [1]:=ord(DateMenu);
  405.     Line[2]:='Cost';            ProcPtr [2] := @DummyProc;
  406.     Line[3]:='Revenue';         ProcPtr [3] := @DummyProc;
  407.     Line[4]:='Taxes';           ProcPtr [4] := @DummyProc;
  408.     Line[5]:='Insurance';       ProcPtr [5] := @DummyProc;
  409.     Line[6]:='Update';          LineMode[6]:=ToSubMenu;
  410.                                 LinkNum [6]:=ord(UpdateMenu);
  411.     Line[7]:='Years';           LineMode[7]:=ToDataWndw;
  412.                                 LinkNum [7]:=ord(BytesDW);
  413.                                 ProcPtr [7] := @DummyProc;
  414.     MsgLineNum  := ord(MainML);
  415.     HelpWndwNum := ord(IRSmenuHW);
  416.     SaveMainMenu;
  417.  
  418.     GetMainMenu (QuitMenu);
  419.   { MenuMode:=ExecChoice; }     { This is the default }
  420.     Title:='Quit';
  421.     Line[1]:='Stay';
  422.     Line[2]:='Quit';            ProcPtr[2] := @SetQuit;
  423.     BackToDefault:=true;
  424.     MsgLineNum  := ord(MainML);
  425.     HelpWndwNum := ord(ExecChoiceHW);
  426.     SaveMainMenu;
  427.  
  428.   { ----------------------- Set up your SubMenus here: --------------------- }
  429.   { Careful! -- indexes to SubMenus must be numbered in order of level; i.e.,}
  430.   { ALL SubMenus first, ALL SubSubMenus second, ALL SubSubSubMenus, ... etc. }
  431.  
  432.     {$ifdef UseSubMenuCode }
  433.  
  434.     GetSubMenu (TiresMenu);
  435.     MenuMode:=SingleChoice;     SingleFlagLine:=5;
  436.     Line[1]:='Brands';          LineMode[1]:=ToSubMenu;
  437.                                 LinkNum[1] :=ord(BrandsMenu);
  438.     Line[2]:='Radials';
  439.     Line[3]:='Knobbies';
  440.     Line[4]:='Track';
  441.     Line[5]:='Snow';
  442.     Line[6]:='All-Weather';
  443.     Line[7]:='4-ply';
  444.     MsgLineNum  := ord(SubML);
  445.     HelpWndwNum := ord(SingleChoiceHW);
  446.     SaveSubMenu;
  447.  
  448.     GetSubMenu (RadioMenu);
  449.     MenuMode:=MultipleChoice;
  450.     Line[1]:='FM Stereo';       Flagged[1]:=true;
  451.     Line[2]:='AM Radio';        Flagged[2]:=true;
  452.     Line[3]:='Tape player';
  453.     Line[4]:='Compact Disc';
  454.     DefaultLine := 4;
  455.     MsgLineNum  := ord(SubML);
  456.     HelpWndwNum := ord(MultipleChoiceHW);
  457.     SaveSubMenu;
  458.  
  459.     GetSubMenu (DateMenu);
  460.   { MenuMode:=ExecChoice; }     { This is the default }
  461.     Line[1]:='Month';           LineMode[1]:=ToDataWndw;
  462.                                 LinkNum [1]:=ord(MonthDW);
  463.                                 ProcPtr [1]:=@DateMenu1;
  464.     Line[2]:='Day';             LineMode[2]:=ToDataWndw;
  465.                                 LinkNum [2]:=ord(DayDW);
  466.                                 ProcPtr [2]:=@DateMenu2;
  467.     Line[3]:='Year';            LineMode[3]:=ToDataWndw;
  468.                                 LinkNum [3]:=ord(YearDW);
  469.                                 ProcPtr [3]:=@DateMenu3;
  470.     BackToDefault := true;
  471.     MsgLineNum  := ord(SubML);
  472.     HelpWndwNum := ord(DateMenuHW);
  473.     SaveSubMenu;
  474.  
  475.     GetSubMenu (UpdateMenu);
  476.   { MenuMode:=ExecChoice; }     { This is the default }
  477.     Line[1]:='1 process';                ProcPtr[1] := @DummyProc;
  478.     Line[2]:='2 process and pop';        ProcPtr[2] := @ProcessThenPop;
  479.     Line[3]:='3 pop and process';        ProcPtr[3] := @PopThenProcess;
  480.     Line[4]:='4 pop, process, pull';     ProcPtr[4] := @PopProcessAndPull;
  481.     Line[5]:='5 pop, pull to Years';     ProcPtr[5] := @PopNumOfLevels;
  482.     Line[6]:='6 pop, pull Radio';        ProcPtr[6] := @PopToNewMenu;
  483.     DefaultLine := 4;
  484.     MsgLineNum  := ord(SubML);
  485.     HelpWndwNum := ord(UpdateMenuHW);
  486.     SaveSubMenu;
  487.  
  488.   { Here's a SubSubMenu: }
  489.     GetSubMenu (BrandsMenu);
  490.     MenuMode:=SingleChoice;     SingleFlagLine:=2;
  491.     Line[1]:='Michelin';
  492.     Line[2]:='General';
  493.     Line[3]:='Firestone';
  494.     Line[4]:='Bridgestone';
  495.     Line[5]:='WeatherGuard';
  496.     DefaultLine := 3;
  497.     MsgLineNum  := ord(SubML);
  498.     HelpWndwNum := ord(BrandsMenuHW);
  499.     SaveSubMenu;
  500.  
  501.     {$endif UseSubMenuCode }
  502.  
  503.   end;  { with TopMenu }
  504.  
  505.   { ----------------------- Set up your Help Windows here: ------------------ }
  506.   { HelpWndw[1] is reserved for the Work window. }
  507.   { HelpWndw[2] is reserved for the top menu. }
  508.  
  509.   {$ifdef UseHelpWndwCode }
  510.   HelpMsgLineNum := ord(HelpML);     { Standard message for a Help window }
  511.   SetHelpLines (WorkWndwHW      ,HLw1 ,HLwL);
  512.   SetHelpLines (TopLineHW       ,HLt1 ,HLtL);
  513.   SetHelpLines (FilesMenuHW     ,HLf1 ,HLfL);
  514.   SetHelpLines (DirMenuHW       ,HLdir1,HLdirL);
  515.   SetHelpLines (EnterDataMenuHW ,HLe1 ,HLeL);
  516.   SetHelpLines (BrandsMenuHW    ,HLb1 ,HLbL);
  517.   SetHelpLines (IRSmenuHW       ,HLi1 ,HLiL);
  518.   SetHelpLines (UpdateMenuHW    ,HLu1 ,HLuL);
  519.   SetHelpLines (ExecChoiceHW    ,HLx1 ,HLxL);
  520.   SetHelpLines (SingleChoiceHW  ,HLs1 ,HLsL);
  521.   SetHelpLines (MultipleChoiceHW,HLm1 ,HLmL);
  522.   SetHelpLines (NumericHW       ,HLn1, HLnL);
  523.   SetHelpLines (TextHW          ,HLtx1,HLtxL);
  524.  
  525.   { ------------------- Set up your Help Lines here: ------------------------ }
  526.   HelpLine[ord(HLw1)]:='              WELCOME TO PULL5X.ARC';
  527.   HelpLine[ord(HLw2)]:='To move the data entry highlight to the desired';
  528.   HelpLine[ord(HLw3)]:='field, use the following keys:';
  529.   HelpLine[ord(HLw4)]:='  '#27'/'#26'            - Left/Right';
  530.   HelpLine[ord(HLw5)]:='  '^X'/'^Y'            - Up/Down nearest cursor';
  531.   HelpLine[ord(HLw6)]:='  Home/Ctrl '#27'    - First one on the row.';
  532.   HelpLine[ord(HLw7)]:='  End /Ctrl '#26'    - Last one on the row';
  533.   HelpLine[ord(HLw8)]:='  PgUp/Ctrl-Home - First in sequence';
  534.   HelpLine[ord(HLw9)]:='  PgDn/Ctrl-End  - Last  in sequence';
  535.   HelpLine[ord(HLw10)]:='  Tab/Shift Tab  - next in sequence';
  536.   HelpLine[ord(HLwL)]:='Any non-extended key will begin editing the field.';
  537.  
  538.   HelpLine[ord(HLt1)]:='Move cursor and press return OR type a command';
  539.   HelpLine[ord(HLtL)]:='letter.  ESC to return to the Work window.';
  540.  
  541.   HelpLine[ord(HLb1)]:='Notice the number of levels for the menus.  This';
  542.   HelpLine[ord(HLb2)]:='menu is a "Single Choice" menu, but you can choose';
  543.   HelpLine[ord(HLb3)]:='from 1 of 3 menu modes:';
  544.   HelpLine[ord(HLb4)]:='  1. ExecChoice     - process only';
  545.   HelpLine[ord(HLb5)]:='  2. SingleChoice   - flag and process';
  546.   HelpLine[ord(HLbL)]:='  3. MultipleChoice - toggle flag and process';
  547.  
  548.   HelpLine[ord(HLf1)]:='This is a "Single Choice" menu, but there are ';
  549.   HelpLine[ord(HLf2)]:='5 of the 7 possible line modes used here:';
  550.   HelpLine[ord(HLf3)]:='* 1. Choice     - interact with other menu choices';
  551.   HelpLine[ord(HLf4)]:='  2. ExecOnly   - process but do not flag';
  552.   HelpLine[ord(HLf5)]:='* 3. Comment    - bypassed by highlight';
  553.   HelpLine[ord(HLf6)]:='* 4. Partition  - mid-menu border';
  554.   HelpLine[ord(HLf7)]:='* 5. ToDataWndw - pulls data entry window';
  555.   HelpLine[ord(HLf8)]:='  6. ToSubMenu  - pulls next submenu level';
  556.   HelpLine[ord(HLf9)]:='* 7. ToUserWndw - like ExecOnly plus menu symbol';
  557.   HelpLine[ord(HLfL)]:='Any combination of the seven works!';
  558.  
  559.   HelpLine[ord(HLe1)]:='Each data entry window can be tailored to any type';
  560.   HelpLine[ord(HLe2)]:='of data:';
  561.   HelpLine[ord(HLe3)]:='  1. Byte     - 0..255';
  562.   HelpLine[ord(HLe4)]:='  2. Word     - 0..65535';
  563.   HelpLine[ord(HLe5)]:='  3. ShortInt - -128..127';
  564.   HelpLine[ord(HLe6)]:='  4. Integer  - -32768..32767';
  565.   HelpLine[ord(HLe7)]:='  5. LongInt  - -2147483647..2147483647';
  566.   HelpLine[ord(HLe8)]:='  6. Real     - any format';
  567.   HelpLine[ord(HLe9)]:='  7. UserNums - user defined numbers, like hex';
  568.   HelpLine[ord(HLe10)]:='  8. Char    - one character';
  569.   HelpLine[ord(HLe11)]:='  9. String  - any length';
  570.   HelpLine[ord(HLe12)]:='Data entry will check validity, range, and user-';
  571.   HelpLine[ord(HLe13)]:='defined limits.   Sets will limit data entry to';
  572.   HelpLine[ord(HLe14)]:='valid characters only.  Field length and labels';
  573.   HelpLine[ord(HLeL)]:='are also user-defined.';
  574.  
  575.   HelpLine[ord(HLi1)]:='This is an "Execute Choice" menu.  But sure to see';
  576.   HelpLine[ord(HLi2)]:='the example of sequential data entry on "Date" and';
  577.   HelpLine[ord(HLiL)]:='menu control on "Update".';
  578.  
  579.   HelpLine[ord(HLd1)]:='This is an "Execute Choice" menu, but there are no';
  580.   HelpLine[ord(HLd2)]:='"choice" lines.  Instead, the lines are all data';
  581.   HelpLine[ord(HLd3)]:='entry lines that have been made to allow either';
  582.   HelpLine[ord(HLdL)]:='random or sequential access.  Start with "Month".';
  583.  
  584.   HelpLine[ord(HLu1)]:='This is an "Execute Choice" menu.  This one will';
  585.   HelpLine[ord(HLu2)]:='show you a few of the possibilities of actually';
  586.   HelpLine[ord(HLuL)]:='controlling the menus themselves.';
  587.  
  588.   HelpLine[ord(HLx1)]:='        This is an "Execute Choice" menu.';
  589.   HelpLine[ord(HLx2)]:='         Notice that there are no flags.';
  590.   HelpLine[ord(HLxL)]:='   "'#240'" means linked SubMenu; "'#250'" - DataWndw.';
  591.  
  592.   HelpLine[ord(HLs1)]:='         This is a "Single Choice" menu.';
  593.   HelpLine[ord(HLs2)]:='          Notice there''s only one flag.';
  594.   HelpLine[ord(HLsL)]:='   "'#240'" means linked SubMenu; "'#250'" - DataWndw.';
  595.  
  596.   HelpLine[ord(HLm1)]:='        This is a "Multiple Choice" menu.';
  597.   HelpLine[ord(HLm2)]:='              Notice several flags.';
  598.   HelpLine[ord(HLmL)]:='   "'#240'" means linked SubMenu; "'#250'" - DataWndw.';
  599.  
  600.   HelpLine[ord(HLdir1)]:='Directory can optionally default to a closely';
  601.   HelpLine[ord(HLdir2)]:='matching name, if any, in the file name entry';
  602.   HelpLine[ord(HLdir3)]:='field.  Pressing CR replaces the name.  Cursor and';
  603.   HelpLine[ord(HLdir4)]:='letter keys move the highlight:';
  604.   HelpLine[ord(HLdir5)]:='  Letter key  - find name with same first letter';
  605.   HelpLine[ord(HLdir6)]:='  '^X'/'^Y'         - move up/down';
  606.   HelpLine[ord(HLdir7)]:='  Home/End    - move to upper/lower file name';
  607.   HelpLine[ord(HLdir8)]:='  PgUp/PgDn   - move up/down a page';
  608.   HelpLine[ord(HLdir9)]:='  ^Home/^End  - move to top/bottom file name';
  609.   HelpLine[ord(HLdirL)]:='  ^PgUp/^PgDn - move to top/bottom page';
  610.  
  611.   HelpLine[ord(HLn1)]:='This is a data entry field for numbers. Only valid';
  612.   HelpLine[ord(HLn2)]:='numbers and symbols can be typed.  Full editing';
  613.   HelpLine[ord(HLn3)]:='capability:';
  614.   HelpLine[ord(HLn4)]:='  1. WordStar keys: ^A,^S,^D,^F,^G,^H,^R,^Y,^U';
  615.   HelpLine[ord(HLn5)]:='  2. Cursor keys:   Home/End, Left/Right Arrow,';
  616.   HelpLine[ord(HLn6)]:='     Ctrl-Left/Right Arrow, and Ins/Del.';
  617.   HelpLine[ord(HLnL)]:='  3. Use ^R or ^U to restore original data.';
  618.  
  619.   HelpLine[ord(HLtx1)]:='This is a data entry field for text.  With the use';
  620.   HelpLine[ord(HLtx2)]:='of sets, only valid letters can be typed.  Full';
  621.   HelpLine[ord(HLtx3)]:='editing capability:';
  622.   HelpLine[ord(HLtx4)]:='  1. WordStar keys: ^A,^S,^D,^F,^G,^H,^R,^Y,^U';
  623.   HelpLine[ord(HLtx5)]:='  2. Cursor keys:   Home/End, Left/Right Arrow,';
  624.   HelpLine[ord(HLtx6)]:='     Ctrl-Left/Right Arrow, and Ins/Del.';
  625.   HelpLine[ord(HLtxL)]:='  3. Use ^R or ^U to restore original data.';
  626.   {$endif UseHelpWndwCode }
  627.  
  628.  
  629.   { ------------------ Set up your Message Lines here: ---------------------- }
  630.   { Concatenations here allow source to print on 80 col printer.              }
  631.   { All messages up to HelpMsg are reserved.                                  }
  632.  
  633.   {$ifdef UseMsgLineCode }
  634.   MsgLine[ord(WorkML)]:=' F1-help  F2-pull  F10-top';
  635.   MsgLine[ord(TopML)] :=' F1-help  F2-pop   LTR-cmd  ESC-return  '+
  636.                         '        '^[^Z' hilight            CR-select';
  637.   MsgLine[ord(AltML)] :=' Alt: F-Files  D-Directory  P-Path      '+
  638.                         '                                 X-Exit';
  639.   MsgLine[ord(MainML)]:=' F1-help  F2-pop   LTR-cmd  ESC-return  '+
  640.                         '        '^[^Z' menus  '^X^Y'-hilight  CR-select';
  641.   MsgLine[ord(SubML)] :=' F1-help  F2-pop   LTR-cmd  ESC-return  '+
  642.                         '                  '^X^Y'-hilight  CR-select';
  643.   MsgLine[ord(DW_ML)] :=' F1-help  F2-pop   F10-top  ESC-restore '+
  644.                         '                              CR-enter';
  645.   MsgLine[ord(DE_ML)] :=' F1-help  F2-pull  F10-top  ESC-restore '+
  646.                         '                              CR-enter';
  647.   MsgLine[ord(SeqML)] :=' F1-help  F2-pull  F10-top              '+
  648.                         '                              CR-edit';
  649.   MsgLine[ord(HelpML)]:=' F1-return         LTR-cmd  ESC-return';
  650.   MsgLine[ord(ProcML)]:=' Processing ...';
  651.   MsgLine[ord(DirML)] :=' F1-help  F2-pop   F10-top  ESC-return  '+
  652.                         '              LTR/'^X^Y'-hilight  CR-select';
  653.   {$endif UseMsgLineCode }
  654.  
  655. end;  { procedure GetUserPullStats }
  656.  
  657. { =========================== GetOverrideStats ============================== }
  658. { You can OVERRIDE the automatic Colors, Sizes, and Locations here.           }
  659. { --------------------------------------------------------------------------- }
  660.  
  661. procedure GetOverrideStats;
  662. begin
  663.   with DirectoryMenu do
  664.     begin
  665.       Title   := 'Directory';
  666.       MenuLines := CRTrows-7;
  667.       Row  := 4;
  668.       Rows := CRTrows-5;
  669.       with MainMenu^[ord(FilesMenu)] do
  670.         DirectoryMenu.Col:=Col+Cols-2;
  671.       Cols   := 16;
  672.       Battr  := BrownBG;
  673.       Wattr  := BrownBG;
  674.       if QvideoMode=Mono then
  675.            Hattr := LightGrayBG
  676.       else Hattr := Yellow;
  677.       Border := SubMenuBrdr;
  678.       MsgLineNum  := ord(DirML);
  679.       HelpWndwNum := ord(DirMenuHW);
  680.     end;
  681.  
  682.   {$ifdef UseSubMenuCode }
  683.   with SubMenu^[ord(BrandsMenu)] do
  684.     begin
  685.       Wattr := Black+BrownBG;
  686.       Battr := Black+BrownBG;
  687.       if QVideoMode<>Mono then
  688.         begin
  689.           Hattr := Yellow+BlackBG;
  690.           Lattr := Yellow+BrownBG;
  691.         end;
  692.     end;
  693.   {$endif UseSubMenuCode }
  694.  
  695.    { The next line changes the command letters on Main Menu 1 to other than
  696.      1st letters.  '#00' is for inaccessible lines. }
  697.   MainMenu^[ord(FilesMenu)].CmdLtrs := 'PMD'#00'MBO';
  698. end;
  699.  
  700. { ========================= CHECK GLOBAL KEYS =============================== }
  701. { This procedure gives you the option to add global keys similar to TP4 such  }
  702. { as Alt-R or Alt-F3.  This is for extended keys only.                        }
  703. { --------------------------------------------------------------------------- }
  704.  
  705. const
  706.   AltF    = #33;    { Files menu }
  707.   AltC    = #46;    { Colors menu }
  708.   AltA    = #30;    { AutoParts menu }
  709.   AltE    = #18;    { EnterData menu }
  710.   AltO    = #24;    { Options menu }
  711.   AltU    = #22;    { Utilities menu }
  712.   AltI    = #23;    { IRSaccounting menu }
  713.   AltQ    = #16;    { Quit menu }
  714.   AltD    = #32;    { Directory menu }
  715.   AltP    = #25;    { Path Data entry }
  716.   AltX    = #45;    { Immediately exit program }
  717.   Alt1    = #120;   { For Work Window 1 }
  718.   Alt2    = #121;   { For Work Window 2 }
  719.  
  720. procedure SetWorkWndw (WN: WindowNames);
  721. begin
  722.   PullDown        := false;
  723.   PopToWorkWndw   := true;
  724.   TopWorkWndwName := WN;
  725. end;
  726.  
  727. { -- Any of the keys can be modified. PopKey and TopKey1 are defined in }
  728. { -- PullVars.inc. }
  729. procedure CheckGlobalKeys;
  730. begin
  731.   PullDown := true;
  732.   case Key of
  733.     PopKey:  begin PullDown:=false; PopToWorkWndw:=true; end; { F2 }
  734.     TopKey1: PopToTop:=true;                                  { F10 }
  735.     AltF:    SetCmdSeq ('F');
  736.     AltC:    SetCmdSeq ('C');
  737.     AltA:    SetCmdSeq ('A');
  738.     AltE:    SetCmdSeq ('E');
  739.     AltO:    SetCmdSeq ('O');
  740.     AltU:    SetCmdSeq ('U');
  741.     AltI:    SetCmdSeq ('I');
  742.     AltQ:    SetCmdSeq ('Q');
  743.     AltD:    SetCmdSeq ('FD');
  744.     AltP:    SetCmdSeq ('FP');
  745.     AltX:    SetQuit;
  746.   else
  747.     PullDown := false;
  748.   end
  749. end;
  750.  
  751. BEGIN
  752.   AddrGetUserPullStats := @GetUserPullStats;
  753.   AddrGetOverrideStats := @GetOverrideStats;
  754.   AddrCheckGlobalKeys  := @CheckGlobalKeys;
  755. END.
  756.